#include "../../client/rpc_client.hpp"
void cb(const std::string &tname, const std::string &msg)
{
    ILOG("收到了%s主题的%s信息",tname.c_str(),msg.c_str());
}
int main()
{
    BRpc::Client::TopicClient client("127.0.0.1",9090);
    bool ret=client.create("happy");
    if(ret==false)
    {
        ELOG("创建主题失败");
    }
    sleep(5);
    for(int i=0;i<10;i++)
    {
        DLOG("发送信息");
        client.publish("happy","test-"+std::to_string(i));
    }
    sleep(2);
    client.subscribe("world",cb);
    sleep(40);
    client.shutdown();
    return 0;
}